package org.study.springboot.learning.socker;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

public class HelloClient {
    public static void main(String[] args) throws IOException {
        Socket socket = null;
        BufferedReader br = null;

        try {
            socket = new Socket("localhost", 18888);
            br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        } catch (IOException e) {
            System.err.println("SocketClient出现异常");
            System.exit(1);
        }

        System.out.println(br.readLine());
        socket.close();
        br.close();
    }
}
